<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return['ischecklogin']=$this->model('member')->get_member();
if($_RQ['op']=='get'){
	$_SESSION['forward_url']='jy_ailiao/member.index/';
	$_SESSION['indexurl']='jy_ailiao/index/';
	$member=$this->model('member')->get_tomember();
	$member['birth']=json_decode($member['birth'],true);
	$member['pcd']=json_decode($member['pcd'],true);
	$member['jiguan']=json_decode($member['jiguan'],true);
	foreach($member['images'] as &$img){
		$img=tomedia($img);
	}
	$current_year=date('Y');
	$member['age'] = $member['birth']['year']?$current_year - $member['birth']['year'] - 1:'**';
	$member['percent']=$this->model('member')->getpercent($member);
	$member['height']=$member['height']?:165;
	$return['member']=$member;
	$return['years']=$this->years;
	$return['months']=array(1,2,3,4,5,6,7,8,9,10,11,12);
	$return['days']=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
	$return['sex']=$this->sex;
	$return['xueli']=$this->xuelis;
	$return['jiehun']=$this->jiehuns;
	$return['shouru']=$this->shourus;
	$return['youboy']=$this->youboy;
	$return['wanboy']=$this->wanboy;
	$return['goufang']=$this->goufang;
	$return['gouche']=$this->gouche;
	$return['height']=$this->heights2;
	$return['weight']=$this->weights2;
	$return['tixing']=$this->tixing;
	$return['xiyan']=$this->xiyan;
	$return['hejiu']=$this->hejiu;
	$return['xingzuo']=$this->xingzuo;
	$return['jh_time']=$this->jh_time;
	$return['minzu']=$this->model('model')->minzus();
	$return['zhiwei']=$this->model('model')->zhiweis();
	set_html('title','会员中心');
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$data=array(
		'city'=>$postdata['pcd']['city'],
		'pcd'=>ijson_encode($postdata['pcd']),
		'jiguan'=>ijson_encode($postdata['jiguan']),
		'birth'=>ijson_encode($postdata['birth']),
		'isjiehun'=>trim($postdata['isjiehun']),
		'xueli'=>trim($postdata['xueli']),
		'shouru'=>trim($postdata['shouru']),
		'youboy'=>intval($postdata['youboy']),
		'wanboy'=>trim($postdata['wanboy']),
		'goufang'=>trim($postdata['goufang']),
		'gouche'=>trim($postdata['gouche']),
		'weight'=>trim($postdata['weight']),
		'height'=>trim($postdata['height']),
		'tixing'=>trim($postdata['tixing']),
		'xiyan'=>trim($postdata['xiyan']),
		'hejiu'=>trim($postdata['hejiu']),
		'xingzuo'=>trim($postdata['xingzuo']),
		'minzu'=>trim($postdata['minzu']),
		'zhiwei'=>trim($postdata['zhiwei']),
		'jh_time'=>trim($postdata['jh_time']),
		'agekey'=>trim($postdata['agekey']),
	);
	$this->update('tomember',$data,array('id'=>$postdata['id']));
	exi('提交成功！');
}